﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SmartSiteManagementSystem.AdminWeb.Extensions;
using SmartSiteManagementSystem.AdminWeb.Models;
using SmartSiteManagementSystem.IServices;
using SmartSiteManagementSystem.Models.Admin;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Mvc;
using SmartSiteManagementSystem.AdminWeb.Filter;

namespace SmartSiteManagementSystem.AdminWeb.ViewComponents
{
	/// <summary>
	/// 首页左侧菜单页
	/// </summary>
	public class AdminIndexLeft: ViewComponent
    {
		private readonly ILogger<AdminIndexLeft> _logger;
		//注入后台服务
		private readonly IAdminService _adminService;
		public AdminIndexLeft(IAdminService adminService, ILogger<AdminIndexLeft> logger)
		{
			_logger = logger;
			_adminService = adminService;
		}

		public IViewComponentResult Invoke()
		{
			#region 验证是否已登录，防止直接访问

			//AdminUserInfo AdminObj = HttpContext.Session.Get<AdminUserInfo>(SessionCookieKeyHelper.SessionKey);
			//if (AdminObj == null)
			//{
			//	//return RedirectToAction("Index", "Login");
			//}
			#endregion 验证是否已登录，防止直接访问

			return View();
		}
	}
}
